package com.ybb.vue.common.util;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.UUID;

/**
 * @author ybb
 * @version 1.0
 * @Description 生成随机的20位单号
 * @Date 2023/4/4 20:05
 */
public class CreateRandOdd {
    public static String createRandOdd(){
        String orderNo = "" ;
        UUID uuid = UUID.randomUUID();
        String chars = "ABCDEFGHIZKLMNOPQRSTUVWXYZ";
        char c1 = chars.charAt((int)(Math.random() * 26));
        char c2 = chars.charAt((int)(Math.random() * 26));
        String sdf = new SimpleDateFormat("MMddHHMMSS").format(new Date());
        orderNo = uuid.toString().substring(0, 8);
        orderNo = String.valueOf(c1) + String.valueOf(c2) + orderNo + sdf;
        return orderNo ;
    }
}
